/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __FOC_kernal_H
#define __FOC_kernal_H

enum {
	man = 2,
	yes = 1,
	no  = 0
};

#define VOLTAGE_LIMIT 12
#define _PWM_RANGE  (4096-1)

#define _round(x) ((x)>=0?(long)((x)+0.5f):(long)((x)-0.5f))
	
#define _PI 3.14159265359f
#define _PI_2 1.57079632679f
#define _PI_3 1.0471975512f
#define _2PI 6.28318530718f
#define _3PI_2 4.71238898038f
#define _PI_6 0.52359877559f
#define _SQRT3 1.73205080757f

#include "tim.h"

void FOC_init(void);
void FOC_SVPWM(float Uq, float Ud, float angle);

#endif /* __FOC_kernal_H */
